<template>
  <div class="mod-config">
    {{statusList}}
    <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
      <el-form-item>
        <el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
      </el-form-item>
      <el-form-item>
        <el-button @click="getDataList()">查询</el-button>
        <el-button v-if="isAuth('interview:interviewinvitation:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
        <el-button v-if="isAuth('interview:interviewinvitation:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
      </el-form-item>
    </el-form>
    <el-table
      :data="dataList"
      border
      v-loading="dataListLoading"
      @selection-change="selectionChangeHandle"
      style="width: 100%;">
      <el-table-column
        type="selection"
        header-align="center"
        align="center"
        width="50">
      </el-table-column>
      <el-table-column
        prop="id"
        header-align="center"
        align="center"
        label="主id">
      </el-table-column>
      <el-table-column
        prop="interviewCompany"
        header-align="center"
        align="center"
        label="面试公司">
        <template slot-scope="scope">
          {{scope.row.interviewCompany+scope.row.number}}
        </template>
      </el-table-column>
      <el-table-column
        prop="interviewTime"
        header-align="center"
        align="center"
        label="面试时间">
        <template slot-scope="scope">
          {{editTime(scope.row,scope.row.interview)}}
        </template>
      </el-table-column>
      <el-table-column
        prop="interviewPosition"
        header-align="center"
        align="center"
        label="面试职位">
      </el-table-column>
      <el-table-column
        prop="interviewAddress"
        header-align="center"
        align="center"
        label="面试地点">
      </el-table-column>
      <el-table-column
        prop="interviewSource"
        header-align="center"
        align="center"
        label="来源">
      </el-table-column>
      <el-table-column
        prop="remarks"
        header-align="center"
        align="center"
        label="备注">
      </el-table-column>
      
      <el-table-column
        fixed="right"
        header-align="center"
        align="center"
        width="150"
        label="操作">
        <template slot-scope="scope">
          <!-- <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
          <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button> -->
          <div v-for="(item1,index) in statusList" :key="'info-'+ index">
            <el-button type="text" size="small"  v-if="scope.row.id==item1.invitationId&&item1.status!=0" @click="addfeedback(scope.row.id)">反馈</el-button>
            <el-button type="text" size="small"  v-if="scope.row.id==item1.invitationId&&item1.status!=0" @click="addresult(item1.id,scope.row)">面试结果</el-button>
            <el-button type="text" size="small"  v-if="scope.row.id==item1.invitationId&&item1.status!=0" @click="log(scope.row)">面试经历</el-button>
          </div>
          <el-button type="text" size="small" v-for="(item,index) in feedbackList" :key="'info1-'+ index"
              v-if="item.invitationId==scope.row.id&&item.uid==1" @click="lookReply(scope.row.id)">复盘</el-button>
          <div v-for="(item,index) in statusList" :key="'info2-'+ index">
            <el-button v-if="item.invitationId==scope.row.id && item.status==0" type="text" size="small" @click="join(scope.row.id,item.id)">面试</el-button>
            <el-button v-if="item.invitationId==scope.row.id && item.status==4" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">复试</el-button>
          </div>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      @size-change="sizeChangeHandle"
      @current-change="currentChangeHandle"
      :current-page="pageIndex"
      :page-sizes="[10, 20, 50, 100]"
      :page-size="pageSize"
      :total="totalPage"
      layout="total, sizes, prev, pager, next, jumper">
    </el-pagination>
    <!-- 弹窗, 新增 / 修改 -->
    <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
    <el-dialog
      title="提示"
      :visible.sync="dialogVisible"
      width="30%">
      <el-form :model="feedback" :inline="true" class="demo-form-inline">
        <el-form-item label="添加图片">
          <el-upload
            action="http://localhost:8868/api/resume/file/upload"
            list-type="picture-card"
            :file-list="feedback.image"
            :on-success="handleAvatarSuccess"
            :on-remove="handleRemove">
            <i class="el-icon-plus"></i>
          </el-upload>
          <el-dialog :visible.sync="dialogVisible1">
            <img width="100%" :src="item.url" v-for="(item,index) in feedback.image" :key="'info3-'+ index" alt="">
          </el-dialog>
        </el-form-item>
        <el-form-item label="录音">
       <div v-for="(item,index) in audioList" :key="index">
           <audio-player     :src="item.soundRecording" />
       </div>
        </el-form-item>
        <el-form-item label="其他文字介绍">
          <el-input type="textarea" v-model="feedback.content" style="width:365px"></el-input>
        </el-form-item>
        <div v-for="(item,index) in problemList" :key="'info4-'+ index">
        <el-form-item label=""><el-button type="primary" style="margin-left:40px;padding:6px;" circle>{{index+1}}</el-button>
          <el-input v-model="item.problem" style="width:370px;padding-left:20px">
          </el-input><el-button style="padding:6px;" type="success" @click="addproblemList" icon="el-icon-plus" circle></el-button>
        </el-form-item>
        <el-form-item label="我的回答:">
          <el-input type="textarea" v-model="item.answer" style="padding-left:15px;width:365px"></el-input>
        </el-form-item>
        </div>
        <el-form-item label="面试官态度:">
          <el-radio v-model="feedback.interviewerAttitude" label="很好">很好</el-radio>
          <el-radio v-model="feedback.interviewerAttitude" label="一般">一般</el-radio>
          <el-radio v-model="feedback.interviewerAttitude" label="平淡">平淡</el-radio>
        </el-form-item>
        <el-form-item label="公司环境:" >
          <el-radio style="padding-left:13px" v-model="feedback.companyEnvironment" label="很好">很好</el-radio>
          <el-radio v-model="feedback.companyEnvironment" label="一般">一般</el-radio>
          <el-radio v-model="feedback.companyEnvironment" label="简陋">简陋</el-radio>
        </el-form-item>
        <el-form-item label="公司总体评价:">
          <el-input type="textarea" v-model="feedback.companyEvaluate" style="width:365px"></el-input>
        </el-form-item>
      </el-form>
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="savefeedback">确 定</el-button>
    </el-dialog>
   <el-dialog
      title="复盘方案"
      :visible.sync="dialogVisiblefupan"
      width="30%">
     
         
            <div v-for="(item,index) in soundList" :key="index">
           <audio-player     :src="item.soundRecording" />
       </div>
      
      <span style="color:#426F42;font-weight:700">文字阐述：</span>{{lookReplyList.content}}<br><br>
      <span style="color:#426F42;font-weight:700">存在问题:</span>
        <br>
        <div
         v-for="item in stringca"
         :key="item" >
           {{item}}<br>
        </div>
         <span style="color:#426F42;font-weight:700"></span>
        <br>
        <br>
          <span style="color:#426F42;font-weight:700">人事问题：</span>{{lookReplyList.personnelContent}}<br>
          <span style="color:#426F42;font-weight:700">项目问题：</span>{{lookReplyList.itemContent}}<br>
          <span style="color:#426F42;font-weight:700">注意内容：</span>{{lookReplyList.attentionContent}}<br>
    <span slot="footer" class="dialog-footer">
      <el-button @click="dialogVisiblefupan = false">取 消</el-button>
      <el-button type="primary" @click="dialogVisiblefupan = false">确 定</el-button>
    </span>
  </el-dialog>

    <el-dialog
    title="提示"
    :visible.sync="dialogVisible3"
    width="30%">
      <el-form :inline="true"  class="demo-form-inline">
        <div  v-if="open==2">
        <el-form-item label="面试结果">
          <el-radio-group v-model="radio">
            <el-radio :label="3">不通过</el-radio>
            <el-radio :label="4">通过可复试</el-radio>
            <el-radio :label="5">通过</el-radio>
          </el-radio-group>
        </el-form-item>
        </div>
        <div v-if="radio==5">
          <el-form-item label="公司名称">
          <el-input v-model="result.interviewCompany" readonly></el-input>
        </el-form-item>
        <el-form-item label="公司地址">
          <el-input v-model="result.interviewAddress" readonly></el-input>
        </el-form-item>
        <el-form-item label="入职时间">
          <el-date-picker
            v-model="result.invitationTime"
            type="datetime"
            placeholder="选择日期时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="试用薪资">
          <el-select v-model="result.interviewTrypay" placeholder="请选择" allow-create>
            <el-option
              v-for="item in options1"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="转正薪资">
          <el-select v-model="result.interviewPay" placeholder="请选择">
            <el-option
              v-for="item in options2"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        </div>
      </el-form>
      <el-button @click="dialogVisible3 = false">取 消</el-button>
      <el-button type="primary" @click="insertresult">确 定</el-button>
  </el-dialog>
  <el-dialog
  title="提示"
  :visible.sync="dialogVisible4"
  width="50%">
    <el-tabs :tab-position="tabPosition" style="height: 300px;">
    <el-tab-pane v-for="(item,index) in logList" :key="index" :label="allMap[item.invitationId]+(index+1)">
      <div class="block">
        <div class="radio">
          排序：
          <el-radio-group v-model="reverse">
            <el-radio :label="true">倒序</el-radio>
            <el-radio :label="false">正序</el-radio>
          </el-radio-group>
        </div>

        <el-timeline :reverse="reverse">
          <el-timeline-item
            v-for="(activity, index) in item.logTime"
            :key="index"
            :timestamp="editTime(activity.date)">
            <span v-if="activity.status==0">接到邀请</span>
            <span v-if="activity.status==1">面试开始</span>
            <span v-if="activity.status==2">面试结束</span>
            <span v-if="activity.status==3">面试没通过</span>
            <span v-if="activity.status==4">需要复试</span>
            <span v-if="activity.status==5">拿到offer</span>
          </el-timeline-item>
        </el-timeline>
      </div>
    </el-tab-pane>
  </el-tabs>
    <el-button @click="dialogVisible4 = false">取 消</el-button>
    <el-button type="primary" @click="dialogVisible4 = false">确 定</el-button>
</el-dialog>
  </div>
</template>

<script>
  import AddOrUpdate from './interviewinvitationaddupdate'
  import moment from 'moment'
  export default {
    data () {
      return {
        dataForm: {
          key: ''
        },
        allMap:{},
        reverse:false,
        logList:[],
        logId:null,
        logTime:[],
        problemData:[],
          solveDao:[],
          stringca:[],
          lookReplyList:[],
          soundList:[],
          invitationId:null,
        readonly:true,
        dataList: [],
        pageIndex: 1,
        pageSize: 10,
        totalPage: 0,
        dataListLoading: false,
        dataListSelections: [],
        addOrUpdateVisible: false,
        dialogVisiblefupan:false,
        statusList:[],
        dialogVisible:false,
        feedback:{
          soundRecording:null,content:null,
          interviewerAttitude:null,
          companyEnvironment:'',
          companyEvaluate:null,
          image:[]
        },
        dialogVisible1:false,
        dialogVisible2:false,
        dialogVisible3:false,
        dialogVisible4:false,
        feedbackList:[],
        reply:{},
        problemList:[{
          problem:'',
          answer:''
        }],
        audioList:[],
        resultStatus:null,
        open:1,
        radio:null,
        classId:null,
        result:{},
         options1: [{value: '11k',label: '11k'}, {value: '12k',label: '12k'}, {value: '13k',label: '13k'}, {value: '14k',label: '14k' }, {value: '15k',label: '15k'}, {value: '16k', label: '16k'}, { value: '17k',label: '17k'}, {value: '18k',label: '18k'},
        {value: '19k', label: '19k'}, {value: '20k', label: '20k' }, {value: '21k', label: '21k' }, { value: '22k',label: '22k'}, {value: '23k',label: '23k'}, {value: '24k', label: '24k' }, { value: '25k', label: '25k'}],
        options2: [{value: '11k',label: '11k'}, {value: '12k',label: '12k'}, {value: '13k',label: '13k'}, {value: '14k',label: '14k' }, {value: '15k',label: '15k'}, {value: '16k', label: '16k'}, { value: '17k',label: '17k'}, {value: '18k',label: '18k'},
        {value: '19k', label: '19k'}, {value: '20k', label: '20k' }, {value: '21k', label: '21k' }, { value: '22k',label: '22k'}, {value: '23k',label: '23k'}, {value: '24k', label: '24k' }, { value: '25k', label: '25k'}],
      }
    },
    components: {
      AddOrUpdate
    },
    activated () {
      this.getDataList()
      this.findByStudentId()
      this.findfeedback()
      this.findSound()
      this.findAll()
    },
    methods: {
      findAll(){
        this.$http({
              url: this.$http.adornUrl(`/interview/interviewinvitation/findAll`),
              method: 'get',
              data: this.$http.adornData({})
            }).then(({data}) => {
              for(const data1 of data.list){
                this.allMap[data1.id] = data1.interviewCompany
              }
            })
      },
      log(row){
        this.dialogVisible4 = true
        this.logList = []
        this.$http({
              url: this.$http.adornUrl(`/interview/interviewlog/findById/1`),
              method: 'get',
              data: this.$http.adornData({})
            }).then(({data}) => {
              for(const data1 of data.list){
                this.logList.push({invitationId:data1.invitationId,logTime:JSON.parse(data1.logTime)})
              }
            })
      },
       findSound(invitationId){
       // alert(this.dataForm.invitationId)
         this.$http({
          url: this.$http.adornUrl(`/interview/Oss/findbyid/${invitationId}`),
          method: 'get'
        }).then(({data}) => {
          this.soundList = data
        })
      },
      huoqu(){
          for(let j=0;j<this.problemData.length;j++){
                this.stringca[j]=this.solveDao[j]+"技术 : 存在问题 "+this.problemData[j].stringValue+"  解决方案  "+this.problemData[j].sloveValue+";"
            alert(this.stringca[j]);
          }
   
      },
       async  lookReply(id){
      this.invitationId=id;
      alert(this.invitationId)
       await  this.$http({
              url: this.$http.adornUrl(`/interview/interviewreply/findReplybyInvitationId/${id}`),
              method: 'get',
              
            }).then(({data}) => {
              this.lookReplyList=data,
              this.problemData=JSON.parse(data.problem),
              this.solveDao=JSON.parse(data.solve)
            })
           await this.huoqu();
           this.findSound(this.invitationId)
        this.dialogVisiblefupan=true;
      },
      editTime(val){//日期处理
      const date = val
      if (date === undefined) {
        return ''
      }
      return moment(date).format('yyyy-MM-DD HH:mm:ss')
    },
      insertresult(){
        this.$http({
              url: this.$http.adornUrl(`/interview/interviewclass/update`),
              method: 'post',
              data: this.$http.adornData({
                'id':this.classId,
                'studentId':1,
                'tearcherId':1,
                'status':this.radio,
                'resumeId':1,
                'invitationId':this.result.invitationId
              })
            }).then(({data}) => {
            })
            this.$http({
              url: this.$http.adornUrl(`/interview/interviewlog/findByinvitationId/${this.result.invitationId}/`),
              method: 'get',
              data: this.$http.adornData({})
            }).then(({data}) => {
              this.logId = data.obj.id
              this.logTime = JSON.parse(data.obj.logTime)
              this.logTime.push({status:this.radio,date:new Date()})
              this.$http({
                  url: this.$http.adornUrl(`/interview/interviewlog/update`),
                  method: 'post',
                  data: this.$http.adornData({
                    'id':this.logId,
                    'studentId':1,
                    'identificationBit':1,
                    'invitationId':this.result.invitationId,
                    'logTime':JSON.stringify(this.logTime)
                  })
                }).then(({data}) => {
                })
            })
            if(this.radio==5){
                this.$http({
              url: this.$http.adornUrl(`/interview/interviewresult/save/`),
              method: 'post',
              data: this.$http.adornData({
                'interviewAddress':this.result.interviewAddress,
                'interviewCompany':this.result.interviewCompany,
                'interviewTrypay':this.result.interviewTrypay,
                'invitationTime':this.result.invitationTime,
                'interviewPay':this.result.interviewPay,
                'invitationId':this.result.invitationId,
                'studentId':1,
              })
            }).then(({data}) => {
            })
            }
              this.dialogVisible3 = false
        
      },
      async addresult(id,row){
        this.result = {}
         this.$http({
              url: this.$http.adornUrl(`/interview/interviewresult/findByInvitationId/${row.id}`),
              method: 'get',
              data: this.$http.adornData({
              })
            }).then(({data}) => {
              if(data.findByInvitationId!=null){
                this.result = data.findByInvitationId
                console.log(this.result)
              }
            })
        if(this.resultStatus==1||this.resultStatus==2){
          this.open=2
        }
        if(this.resultStatus==3){
          this.dialogVisible3 = false
          alert("你的面试没有通过")
        }
        this.classId = id
        this.result.invitationId = row.id
        this.result.interviewAddress = row.interviewAddress
        this.result.interviewCompany = row.interviewCompany
        await this.$http({
              url: this.$http.adornUrl(`/interview/interviewclass/info/${id}`),
              method: 'get',
              data: this.$http.adornData({
              })
            }).then(({data}) => {
              this.resultStatus = data.interviewClass.status
              this.dialogVisible3 = true
            })
        if(this.resultStatus==1||this.resultStatus==2){
          this.open=2
        }
        if(this.resultStatus==3){
          this.dialogVisible3 = false
          alert("你的面试没有通过")
        }
        if(this.resultStatus==4){
          this.dialogVisible3 = false
          alert("请等待复试")
        }
        if(this.resultStatus==5){
          this.radio = this.resultStatus
        }
      },
      addproblemList(){
        this.problemList.push({
          problem:'',
          answer:''
        })
      },
      async join(invitationId,id){
        await this.$http({
              url: this.$http.adornUrl(`/interview/interviewclass/update`),
              method: 'post',
              data: this.$http.adornData({
                'id':id,
                'studentId':1,
                'tearcherId':1,
                'status':1,
                'resumeId':1,
                'invitationId':row.id
              })
            }).then(({data}) => {
            })
        await this.$http({
              url: this.$http.adornUrl(`/interview/interviewlog/findByinvitationId/${row.id}`),
              method: 'get',
              data: this.$http.adornData({})
            }).then(({data}) => {
              this.logId = data.obj.id
              this.logTime = JSON.parse(data.obj.logTime)
              this.logTime.push({status:1,date:new Date()});
              this.$http({
                  url: this.$http.adornUrl(`/interview/interviewlog/update`),
                  method: 'post',
                  data: this.$http.adornData({
                    'id':this.logId,
                    'studentId':1,
                    'identificationBit':1,
                    'invitationId':row.invitationId,
                    'logTime': JSON.stringify(this.logTime)
                  })
                }).then(({data}) => {
                })
            })
        this.$router.push({path:'interview-App2',query:{id:`${id}`,invitationId:`${invitationId}`}})
      },
      echoreply(id){
        this.dialogVisible2 = true
        let uid = 1
        this.$http({
              url: this.$http.adornUrl(`/interview/interviewreply/findByUid/${id}/${uid}`),
              method: 'get',
              data: this.$http.adornData({
              })
            }).then(({data}) => {
              this.reply = data.reply
            })
      },
      findfeedback(){
        this.$http({
              url: this.$http.adornUrl(`/interview/interviewfeedback/list`),
              method: 'post',
              data: this.$http.adornData({
              })
            }).then(({data}) => {
              this.feedbackList = data.page.list
            })
      },
      savefeedback(){
        let problemList = []
        let answerList = []
        for(const data of this.problemList){
          problemList.push(data.problem)
          answerList.push(data.answer)
        }
         this.$http({
              url: this.$http.adornUrl(`/interview/interviewfeedback/${!this.feedback.id ? 'save' : 'update'}`),
              method: 'post',
              data: this.$http.adornData({
                'id': this.feedback.id || undefined,
                'image': JSON.stringify(this.feedback.image),
                'soundRecording': this.feedback.soundRecording,
                'content': this.feedback.content,
                'problem': JSON.stringify(problemList),
                'answer': JSON.stringify(answerList),
                'invitationId': this.feedback.invitationId,
                'companyEnvironment':this.feedback.companyEnvironment,
                'interviewerAttitude':this.feedback.interviewerAttitude,
                'companyEvaluate':this.feedback.companyEvaluate,
                'uid': 1
              })
            }).then(({data}) => {
              if (data && data.code === 0) {
                this.$message({
                  message: '操作成功',
                  type: 'success',
                  duration: 1500,
                  onClose: () => {
                    this.visible = false
                    this.$emit('refreshDataList')
                  }
                })
              } else {
                this.$message.error(data.msg)
              }
            })
            this.dialogVisible = false  
      },
      handleRemove(file, fileList) {
        alert(JSON.stringify(file))
        for(let i=0;i<this.feedback.image.length;i++){
          if(this.feedback.image[i]==file){
            this.feedback.image.splice(i,1)
          }
        }
    },
    handleAvatarSuccess(res, file) {
      this.feedback.image.push({url:res.messages})
    },
      addfeedback(id){
        this.$http({
          url: this.$http.adornUrl(`/interview/Oss/findbyid/${id}`),
          method: 'get',
          data: this.$http.adornParams()
        }).then(({data}) => {
          this.audioList = data
        })
        this.feedback = {}
        this.problemList = [{
          problem:'',
          answer:''
        }]
        let uid = 1
        this.$http({
              url: this.$http.adornUrl(`/interview/interviewfeedback/findByinvitationId/${id}/${uid}`),
              method: 'get',
              data: this.$http.adornData({
              })
            }).then(({data}) => {
              if(data.feedback!=null){
                this.feedback = data.feedback
                this.feedback.image = JSON.parse(data.feedback.image)
                this.problemList=[]
                let problemList1 = JSON.parse(data.feedback.problem)
                let answerList = JSON.parse(data.feedback.answer)
                for(let i=0;i<problemList1.length;i++){
                  this.problemList.push({
                    problem:problemList1[i],
                    answer:answerList[i]
                  })
                }
              }
            })
        this.dialogVisible = true
        this.feedback.invitationId = id
      },
      //获取学生状态
      findByStudentId(){
        let studentId = 1
        this.$http({
          url: this.$http.adornUrl(`/interview/interviewclass/findByStudent/${studentId}`),
          method: 'get',
          data: this.$http.adornParams()
        }).then(({data}) => {
          this.statusList = data.list
        })
      },
      // 获取数据列表
      getDataList () {
        this.dataListLoading = true
        this.$http({
          url: this.$http.adornUrl('/interview/interviewinvitation/list'),
          method: 'post',
          data: this.$http.adornParams({
            'page': this.pageIndex+'',
            'limit': this.pageSize+'',
            'key': this.dataForm.key
          })
        }).then(({data}) => {
          if (data && data.code === 0) {
            this.dataList = data.page.list
            this.totalPage = data.page.totalCount
          } else {
            this.dataList = []
            this.totalPage = 0
          }
          this.dataListLoading = false
        })
      },
      // 每页数
      sizeChangeHandle (val) {
        this.pageSize = val
        this.pageIndex = 1
        this.getDataList()
      },
      // 当前页
      currentChangeHandle (val) {
        this.pageIndex = val
        this.getDataList()
      },
      // 多选
      selectionChangeHandle (val) {
        this.dataListSelections = val
      },
      // 新增 / 修改
      addOrUpdateHandle (id) {
            this.addOrUpdateVisible = true
            this.$nextTick(() => {
              this.$refs.addOrUpdate.init(id)
            })
      },
      // 删除
      deleteHandle (id) {
        var ids = id ? [id] : this.dataListSelections.map(item => {
          return item.id
        })
        this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.$http({
            url: this.$http.adornUrl('/interview/interviewinvitation/delete'),
            method: 'post',
            data: this.$http.adornData(ids, false)
          }).then(({data}) => {
            if (data && data.code === 0) {
              this.$message({
                message: '操作成功',
                type: 'success',
                duration: 1500,
                onClose: () => {
                  this.getDataList()
                }
              })
            } else {
              this.$message.error(data.msg)
            }
          })
        })
      }
    }
  }
</script>
